<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    var obj = {
        name:"达姆",
        a:function(){
            //that是鸡肋闭包
            // var that = this;
            //数组大部分的api都是同步的回调
            /*[1,2,3].forEach(function (item) {
                that.b(item)
            })*/
            [1,2,3].forEach((item) => {
                this.b(item)
            })
            console.log("a 函数")
        },
        b:function(num){
            console.log("b 函数:"+num)
        }
    }

    obj.a()
</script>
</html>